package com.group02.community.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.group02.community.entity.community.ZyCommunity;
//import com.group02.community.entity.vo.ZyCommunityVO;
import com.group02.community.entity.vo.ZyCommunityVO;
import com.group02.community.mapper.CommunityMapper;
import com.group02.community.service.CommunityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CommunityServiceImpl extends ServiceImpl<CommunityMapper, ZyCommunity> implements CommunityService {
    @Autowired
    private CommunityMapper communityMapper;

    @Override
    public IPage<ZyCommunityVO> getCommunityList(Integer currentPage, Integer pageSize, ZyCommunity zyCommunity) {
        return communityMapper.getCommunityList(new Page<>(currentPage, pageSize), zyCommunity);
    }

    @Override
    public List<String> getCommunityNameList() {
        return communityMapper.getCommunityNameList();
    }

    @Override
    public void updateDeptById(String communityId, String deptId) {
        communityMapper.updateDeptById( communityId,  deptId);
    }


}
